/*     */ package com.yc.dao.station;
/*     */ 
/*     */ import btsm.bean.dbConnector;
/*     */ import com.yc.dao.model.GeograpNoBO;
/*     */ import com.yc.dao.model.GeographicalenvBo;
/*     */ import com.yc.util.FormateSQL;
/*     */ import com.yc.util.ListContentsBFO;
/*     */ import com.yc.web.station.IExportService;
/*     */ import java.sql.ResultSet;
/*     */ import java.text.SimpleDateFormat;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Date;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import org.apache.commons.logging.Log;
/*     */ import org.apache.commons.logging.LogFactory;
/*     */ 
/*     */ public class GeographicalenvDAO
/*     */   implements IExportService
/*     */ {
/*  25 */   private static final Log log = LogFactory.getLog(GeographicalenvDAO.class);
/*     */ 
/*  27 */   private dbConnector dbcon = null;
/*  28 */   private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
/*     */ 
/*     */   private void dbConInit() {
/*  31 */     if (this.dbcon == null)
/*  32 */       this.dbcon = new dbConnector();
/*     */   }
/*     */ 
/*     */   private void dbConClose() {
/*  36 */     if (this.dbcon != null)
/*  37 */       this.dbcon.closeAll();
/*  38 */     this.dbcon = null;
/*     */   }
/*     */ 
/*     */   public GeographicalenvBo getInfoByBtsCode(String btscode)
/*     */   {
/*  43 */     ResultSet rs = null;
/*  44 */     List list = new ArrayList();
/*  45 */     GeographicalenvBo bo = null;
/*     */     try
/*     */     {
/*  48 */       dbConInit();
/*  49 */       String strSQL = " select * from geographicalenv where btscode ='" + btscode + "' ";
/*  50 */       log.info(strSQL);
/*  51 */       rs = this.dbcon.execQuery(strSQL);
/*  52 */       if (rs.next()) {
/*  53 */         bo = new GeographicalenvBo();
/*  54 */         bo.setBtscode(rs.getString("btscode"));
/*  55 */         bo.setBtsname(rs.getString("btsname"));
/*  56 */         bo.setBtszone(rs.getString("btszone"));
/*  57 */         bo.setLandform(rs.getString("landform"));
/*  58 */         bo.setLng(rs.getString("lng"));
/*  59 */         bo.setLat(rs.getString("lat"));
/*  60 */         bo.setRelocationrd(rs.getString("relocationrd"));
/*  61 */         bo.setUsername(rs.getString("username"));
/*  62 */         bo.setDistcode(rs.getString("distcode"));
/*  63 */         bo.setBtslevel(rs.getString("btslevel"));
/*  64 */         bo.setWorkingradius(rs.getString("workingradius"));
/*  65 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/*  66 */         bo.setMemo(rs.getString("memo"));
/*  67 */         bo.setGraphDeatilAddr(rs.getString("graphDeatilAddr"));
/*  68 */         bo.setGraphHigh(rs.getString("graphHigh"));
/*     */ 
/*  70 */         bo.setTrannetid(rs.getString("trannetid"));
/*  71 */         bo.setTrannetname(rs.getString("trannetname"));
/*  72 */         bo.setTrannetgrade(rs.getString("trannetgrade"));
/*  73 */         bo.setRegisttime(rs.getDate("registtime"));
/*  74 */         bo.setBtskind(rs.getString("btskind"));
/*  75 */         bo.setBtstype(rs.getString("btstype"));
/*  76 */         bo.setCoverage(rs.getString("coverage"));
/*  77 */         bo.setMaintype(rs.getString("maintype"));
/*     */       }
/*     */     }
/*     */     catch (Exception e) {
/*  81 */       e.printStackTrace();
/*  82 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/*  85 */       dbConClose();
/*     */     }
/*  87 */     return bo;
/*     */   }
/*     */ 
/*     */   public boolean saveGeographicalenvBo(GeographicalenvBo bo)
/*     */   {
/*  92 */     boolean flag = true;
/*     */     try
/*     */     {
/*  95 */       dbConInit();
/*  96 */       StringBuffer sqlBuf = new StringBuffer();
/*  97 */       sqlBuf.append(" insert into geographicalenv (  btscode,  btsname, btszone, landform, lng, ");
/*  98 */       sqlBuf.append(" lat, relocationrd, username, distcode, btslevel, workingradius, ");
/*  99 */       sqlBuf.append("  refreshtime,  memo, graphDeatilAddr,  graphHigh,trannetid , ");
/* 100 */       sqlBuf.append("  trannetname,  trannetgrade, registtime,  btskind,btstype,coverage,maintype ) values ( ");
/* 101 */       sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 102 */       sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 103 */       sqlBuf.append(" '" + bo.getBtszone() + "' ,");
/* 104 */       sqlBuf.append(" '" + bo.getLandform() + "' ,");
/* 105 */       sqlBuf.append(" '" + bo.getLng() + "' ,");
/* 106 */       sqlBuf.append(" '" + bo.getLat() + "' ,");
/* 107 */       sqlBuf.append(" '" + bo.getRelocationrd() + "' ,");
/* 108 */       sqlBuf.append(" '" + bo.getUsername() + "' ,");
/* 109 */       sqlBuf.append(" '" + bo.getDistcode() + "' ,");
/* 110 */       sqlBuf.append(" '" + bo.getBtslevel() + "' ,");
/* 111 */       sqlBuf.append(" '" + bo.getWorkingradius() + "' ,");
/* 112 */       sqlBuf.append(" '" + this.sdf.format(new Date()) + "' ,");
/* 113 */       sqlBuf.append(" '" + bo.getMemo() + "' ,");
/* 114 */       sqlBuf.append(" '" + bo.getGraphDeatilAddr() + "' ,");
/* 115 */       sqlBuf.append(" '" + bo.getGraphHigh() + "' ,");
/*     */ 
/* 117 */       sqlBuf.append(" '" + bo.getTrannetid() + "' ,");
/* 118 */       sqlBuf.append(" '" + bo.getTrannetname() + "' ,");
/* 119 */       sqlBuf.append(" '" + bo.getTrannetgrade() + "' ,");
/* 120 */       sqlBuf.append(" '" + this.sdf.format(new Date()) + "' ,");
/* 121 */       sqlBuf.append(" '" + bo.getBtskind() + "' ,");
/* 122 */       sqlBuf.append(" '" + bo.getBtstype() + "' ,");
/* 123 */       sqlBuf.append(" '" + bo.getCoverage() + "' ,");
/* 124 */       sqlBuf.append(" '" + bo.getMaintype() + "' )");
/*     */ 
/* 126 */       log.info(sqlBuf.toString());
/* 127 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 131 */       flag = false;
/* 132 */       e.printStackTrace();
/* 133 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 136 */       dbConClose();
/*     */     }
/* 138 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean updateGeographicalenv(GeographicalenvBo bo)
/*     */   {
/* 148 */     boolean flag = true;
/*     */     try
/*     */     {
/* 151 */       dbConInit();
/* 152 */       StringBuffer sqlBuf = new StringBuffer();
/* 153 */       sqlBuf.append(" update geographicalenv set  ");
/* 154 */       sqlBuf.append(" btszone = '" + bo.getBtszone() + "' ,");
/* 155 */       sqlBuf.append(" landform = '" + bo.getLandform() + "' ,");
/* 156 */       sqlBuf.append(" lng = '" + bo.getLng() + "' ,");
/* 157 */       sqlBuf.append(" lat = '" + bo.getLat() + "' ,");
/* 158 */       sqlBuf.append(" relocationrd = '" + bo.getRelocationrd() + "' ,");
/* 159 */       sqlBuf.append(" username = '" + bo.getUsername() + "' ,");
/* 160 */       sqlBuf.append(" distcode = '" + bo.getDistcode() + "' ,");
/* 161 */       sqlBuf.append(" btslevel = '" + bo.getBtslevel() + "' ,");
/* 162 */       sqlBuf.append(" workingradius = '" + bo.getWorkingradius() + "' ,");
/* 163 */       sqlBuf.append(" refreshtime = '" + this.sdf.format(new Date()) + "' ,");
/* 164 */       sqlBuf.append(" memo = '" + bo.getMemo() + "' ,");
/* 165 */       sqlBuf.append(" graphDeatilAddr = '" + bo.getGraphDeatilAddr() + "' ,");
/* 166 */       sqlBuf.append(" graphHigh = '" + bo.getGraphHigh() + "', ");
/*     */ 
/* 168 */       sqlBuf.append(" trannetid = '" + bo.getTrannetid() + "' ,");
/* 169 */       sqlBuf.append(" trannetname = '" + bo.getTrannetname() + "' ,");
/* 170 */       sqlBuf.append(" trannetgrade = '" + bo.getTrannetgrade() + "' ,");
/* 171 */       sqlBuf.append(" registtime = '" + this.sdf.format(bo.getRegisttime()) + "' ,");
/*     */ 
/* 173 */       sqlBuf.append(" btskind = '" + bo.getBtskind() + "' ,");
/* 174 */       sqlBuf.append(" btstype = '" + bo.getBtstype() + "' ,");
/* 175 */       sqlBuf.append(" coverage = '" + bo.getCoverage() + "' ,");
/* 176 */       sqlBuf.append(" maintype = '" + bo.getMaintype() + "' ");
/*     */ 
/* 178 */       sqlBuf.append(" where btscode = '" + bo.getBtscode() + "'");
/*     */ 
/* 180 */       log.info(sqlBuf.toString());
/* 181 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 185 */       flag = false;
/* 186 */       e.printStackTrace();
/* 187 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 190 */       dbConClose();
/*     */     }
/* 192 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean saveGeographicalenvNoBo(GeograpNoBO bo)
/*     */   {
/* 198 */     boolean flag = true;
/*     */     try
/*     */     {
/* 201 */       dbConInit();
/* 202 */       StringBuffer sqlBuf = new StringBuffer();
/* 203 */       sqlBuf.append(" insert into geograpno (  btscode,  btsCodeNo,other ) values ( ");
/* 204 */       sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 205 */       sqlBuf.append(" '" + bo.getBtsCodeNo() + "' ,");
/* 206 */       sqlBuf.append(" '" + bo.getOther() + "' )");
/* 207 */       log.info(sqlBuf.toString());
/* 208 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 212 */       flag = false;
/* 213 */       e.printStackTrace();
/* 214 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 217 */       dbConClose();
/*     */     }
/* 219 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean updateGeographicalenvNoBo(GeograpNoBO bo)
/*     */   {
/* 224 */     boolean flag = true;
/*     */     try
/*     */     {
/* 227 */       dbConInit();
/* 228 */       StringBuffer sqlBuf = new StringBuffer();
/* 229 */       sqlBuf.append(" update  geograpno  set ");
/* 230 */       sqlBuf.append(" btsCodeNo = '" + bo.getBtsCodeNo() + "' ,");
/* 231 */       sqlBuf.append(" other = '" + bo.getOther() + "'  ");
/* 232 */       sqlBuf.append(" where id = '" + bo.getId() + "'  ");
/* 233 */       log.info(sqlBuf.toString());
/* 234 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 238 */       flag = false;
/* 239 */       e.printStackTrace();
/* 240 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 243 */       dbConClose();
/*     */     }
/* 245 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteGeographicalenvNoBo(GeograpNoBO bo)
/*     */   {
/* 250 */     boolean flag = true;
/*     */     try
/*     */     {
/* 253 */       dbConInit();
/* 254 */       StringBuffer sqlBuf = new StringBuffer();
/* 255 */       sqlBuf.append(" delete from  geograpno  ");
/* 256 */       sqlBuf.append(" where id = '" + bo.getId() + "'  ");
/* 257 */       log.info(sqlBuf.toString());
/* 258 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 262 */       flag = false;
/* 263 */       e.printStackTrace();
/* 264 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 267 */       dbConClose();
/*     */     }
/* 269 */     return flag;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getNoList(Map condition)
/*     */   {
/* 274 */     ListContentsBFO bfo = new ListContentsBFO();
/* 275 */     String strBtscode = condition.get("BTS_CODE").toString();
/* 276 */     ResultSet rs = null;
/* 277 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 280 */       dbConInit();
/* 281 */       String strSQL = " select * from geograpno where btscode ='" + strBtscode + "' order by other";
/* 282 */       log.info(strSQL);
/* 283 */       rs = this.dbcon.execQuery(strSQL);
/* 284 */       while (rs.next()) {
/* 285 */         GeograpNoBO bo = new GeograpNoBO();
/* 286 */         bo.setId(rs.getString("id"));
/* 287 */         bo.setBtscode(rs.getString("btscode"));
/* 288 */         bo.setBtsCodeNo(rs.getString("btsCodeNo"));
/* 289 */         bo.setOther(rs.getString("other"));
/* 290 */         list.add(bo);
/*     */       }
/* 292 */       bfo.setData(list.toArray());
/* 293 */       bfo.setTotalSize(list.size());
/*     */     }
/*     */     catch (Exception e) {
/* 296 */       e.printStackTrace();
/* 297 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 300 */       dbConClose();
/*     */     }
/* 302 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getAllStationList(Map condition)
/*     */   {
/* 308 */     log.info("query all station begin ");
/* 309 */     ListContentsBFO bfo = new ListContentsBFO();
/* 310 */     int start = Integer.parseInt(condition.get("start").toString());
/* 311 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 312 */     String strUserId = condition.get("USER_ID").toString();
/* 313 */     String strUserRoleName = condition.get("USER_ROLE").toString();
/* 314 */     Object queryObj = condition.get("query");
/* 315 */     ResultSet rs = null;
/* 316 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 319 */       dbConInit();
/* 320 */       String strSQL = "";
/* 321 */       if ((queryObj == null) || ("".equalsIgnoreCase(queryObj.toString().trim())))
/*     */       {
/* 323 */         if ("admin".equals(strUserRoleName))
/* 324 */           strSQL = "select count(btscode) from geographicalenv ";
/*     */         else
/* 326 */           strSQL = "select count(btscode) from geographicalenv where username='" + strUserId + "'";
/*     */       }
/* 328 */       else if ("admin".equals(strUserRoleName))
/* 329 */         strSQL = "select count(btscode) from geographicalenv where  binary ucase(btsname) like concat('%',ucase('" + 
/* 330 */           queryObj.toString() + "'),'%') ";
/*     */       else {
/* 332 */         strSQL = "select count(btscode) from geographicalenv where username='" + strUserId + "' and " + 
/* 333 */           "  binary ucase(btsname) like concat('%',ucase('" + queryObj.toString() + "'),'%') ";
/*     */       }
/*     */ 
/* 337 */       log.info(strSQL);
/* 338 */       rs = this.dbcon.execQuery(strSQL);
/* 339 */       if (rs.next()) {
/* 340 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 342 */       if ((queryObj == null) || ("".equalsIgnoreCase(queryObj.toString().trim())))
/*     */       {
/* 344 */         if ("admin".equals(strUserRoleName))
/* 345 */           strSQL = "select * from geographicalenv order by refreshtime desc limit " + start + ", " + limit;
/*     */         else
/* 347 */           strSQL = "select * from geographicalenv where username='" + strUserId + "' order by refreshtime desc limit " + start + ", " + limit;
/*     */       }
/* 349 */       else if ("admin".equals(strUserRoleName))
/* 350 */         strSQL = "select * from geographicalenv where  binary ucase(btsname) like concat('%',ucase('" + 
/* 351 */           queryObj.toString() + "'),'%') " + 
/* 352 */           " order by refreshtime desc limit " + start + ", " + limit;
/*     */       else {
/* 354 */         strSQL = "select * from geographicalenv where  binary ucase(btsname) like concat('%',ucase('" + 
/* 355 */           queryObj.toString() + "'),'%') and username='" + strUserId + "' " + 
/* 356 */           " order by refreshtime desc limit " + start + ", " + limit;
/*     */       }
/*     */ 
/* 360 */       log.info(strSQL);
/* 361 */       rs = this.dbcon.execQuery(strSQL);
/* 362 */       int i = 0;
/* 363 */       while (rs.next()) {
/* 364 */         GeographicalenvBo bo = new GeographicalenvBo();
/* 365 */         bo.setId(String.valueOf(i++));
/* 366 */         bo.setBtscode(rs.getString("btscode"));
/* 367 */         bo.setBtsname(rs.getString("btsname"));
/* 368 */         bo.setBtszone(rs.getString("btszone"));
/* 369 */         bo.setLandform(rs.getString("landform"));
/* 370 */         bo.setLng(rs.getString("lng"));
/* 371 */         bo.setLat(rs.getString("lat"));
/* 372 */         bo.setRelocationrd(rs.getString("relocationrd"));
/* 373 */         bo.setUsername(rs.getString("username"));
/* 374 */         bo.setDistcode(rs.getString("distcode"));
/* 375 */         bo.setBtslevel(rs.getString("btslevel"));
/* 376 */         bo.setWorkingradius(rs.getString("workingradius"));
/* 377 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 378 */         bo.setMemo(rs.getString("memo"));
/* 379 */         bo.setGraphDeatilAddr(rs.getString("graphDeatilAddr"));
/* 380 */         bo.setGraphHigh(rs.getString("graphHigh"));
/*     */ 
/* 382 */         bo.setTrannetid(rs.getString("trannetid"));
/* 383 */         bo.setTrannetname(rs.getString("trannetname"));
/* 384 */         bo.setTrannetgrade(rs.getString("trannetgrade"));
/* 385 */         bo.setRegisttime(rs.getDate("registtime"));
/* 386 */         bo.setBtskind(rs.getString("btskind"));
/* 387 */         bo.setBtstype(rs.getString("btstype"));
/* 388 */         bo.setCoverage(rs.getString("coverage"));
/* 389 */         bo.setMaintype(rs.getString("maintype"));
/* 390 */         if ("admin".equals(strUserRoleName)) {
/* 391 */           bo.setCanEdit("EDIT_YES");
/*     */         }
/* 394 */         else if (strUserId.equals(rs.getString("username")))
/*     */         {
/* 396 */           bo.setCanEdit("EDIT_YES");
/*     */         }
/*     */         else {
/* 399 */           bo.setCanEdit("EDIT_NO");
/*     */         }
/*     */ 
/* 403 */         list.add(bo);
/*     */       }
/* 405 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 408 */       e.printStackTrace();
/* 409 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 412 */       dbConClose();
/*     */     }
/* 414 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getAllStationListForBrowse(Map condition)
/*     */   {
/* 420 */     log.info("query all station begin ");
/* 421 */     ListContentsBFO bfo = new ListContentsBFO();
/* 422 */     int start = Integer.parseInt(condition.get("start").toString());
/* 423 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 424 */     String strUserId = condition.get("USER_ID").toString();
/* 425 */     String strUserRoleName = condition.get("USER_ROLE").toString();
/* 426 */     Object queryObj = condition.get("query");
/* 427 */     ResultSet rs = null;
/* 428 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 431 */       dbConInit();
/* 432 */       String strSQL = "";
/* 433 */       if ((queryObj == null) || ("".equalsIgnoreCase(queryObj.toString().trim())))
/*     */       {
/* 435 */         strSQL = "select count(btscode) from geographicalenv ";
/*     */       }
/*     */       else {
/* 438 */         strSQL = "select count(btscode) from geographicalenv where  binary ucase(btsname) like concat('%',ucase('" + 
/* 439 */           queryObj.toString() + "'),'%') ";
/*     */       }
/*     */ 
/* 443 */       log.info(strSQL);
/* 444 */       rs = this.dbcon.execQuery(strSQL);
/* 445 */       if (rs.next()) {
/* 446 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 448 */       if ((queryObj == null) || ("".equalsIgnoreCase(queryObj.toString().trim())))
/*     */       {
/* 450 */         strSQL = "select * from geographicalenv order by refreshtime desc limit " + start + ", " + limit;
/*     */       }
/*     */       else {
/* 453 */         strSQL = "select * from geographicalenv where  binary ucase(btsname) like concat('%',ucase('" + 
/* 454 */           queryObj.toString() + "'),'%') " + 
/* 455 */           " order by refreshtime desc limit " + start + ", " + limit;
/*     */       }
/* 457 */       log.info(strSQL);
/* 458 */       rs = this.dbcon.execQuery(strSQL);
/* 459 */       int i = 0;
/* 460 */       while (rs.next()) {
/* 461 */         GeographicalenvBo bo = new GeographicalenvBo();
/* 462 */         bo.setId(String.valueOf(i++));
/* 463 */         bo.setBtscode(rs.getString("btscode"));
/* 464 */         bo.setBtsname(rs.getString("btsname"));
/* 465 */         bo.setBtszone(rs.getString("btszone"));
/* 466 */         bo.setLandform(rs.getString("landform"));
/* 467 */         bo.setLng(rs.getString("lng"));
/* 468 */         bo.setLat(rs.getString("lat"));
/* 469 */         bo.setRelocationrd(rs.getString("relocationrd"));
/* 470 */         bo.setUsername(rs.getString("username"));
/* 471 */         bo.setDistcode(rs.getString("distcode"));
/* 472 */         bo.setBtslevel(rs.getString("btslevel"));
/* 473 */         bo.setWorkingradius(rs.getString("workingradius"));
/* 474 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 475 */         bo.setMemo(rs.getString("memo"));
/* 476 */         bo.setGraphDeatilAddr(rs.getString("graphDeatilAddr"));
/* 477 */         bo.setGraphHigh(rs.getString("graphHigh"));
/*     */ 
/* 479 */         bo.setTrannetid(rs.getString("trannetid"));
/* 480 */         bo.setTrannetname(rs.getString("trannetname"));
/* 481 */         bo.setTrannetgrade(rs.getString("trannetgrade"));
/* 482 */         bo.setRegisttime(rs.getDate("registtime"));
/* 483 */         bo.setBtskind(rs.getString("btskind"));
/* 484 */         bo.setBtstype(rs.getString("btstype"));
/* 485 */         bo.setCoverage(rs.getString("coverage"));
/* 486 */         bo.setMaintype(rs.getString("maintype"));
/* 487 */         bo.setCanEdit("EDIT_YES");
/*     */ 
/* 489 */         list.add(bo);
/*     */       }
/* 491 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 494 */       e.printStackTrace();
/* 495 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 498 */       dbConClose();
/*     */     }
/* 500 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean deleteGeographicalenvBo(String btsCode)
/*     */   {
/* 507 */     boolean flag = true;
/*     */     try {
/* 509 */       dbConInit();
/* 510 */       String strSQL = "delete from geographicalenv  where btscode = '" + btsCode + "' ";
/* 511 */       log.info(strSQL);
/* 512 */       this.dbcon.execUpdate(strSQL);
/* 513 */       strSQL = "delete from geograpno  where btscode = '" + btsCode + "' ";
/* 514 */       log.info(strSQL);
/* 515 */       this.dbcon.execUpdate(strSQL);
/* 516 */       strSQL = "delete from bts_new  where btscode = '" + btsCode + "' ";
/* 517 */       log.info(strSQL);
/* 518 */       this.dbcon.execUpdate(strSQL);
/* 519 */       strSQL = "delete from storagebattery  where btscode = '" + btsCode + "' ";
/* 520 */       log.info(strSQL);
/* 521 */       this.dbcon.execUpdate(strSQL);
/* 522 */       strSQL = "delete from bathunder  where btscode = '" + btsCode + "' ";
/* 523 */       log.info(strSQL);
/* 524 */       this.dbcon.execUpdate(strSQL);
/*     */ 
/* 526 */       strSQL = "delete from acdcdistributionmap  where acdcid in (select u.id from (  select id from acdcdistribution where btscode = '" + btsCode + "' )as u) ";
/* 527 */       log.info(strSQL);
/* 528 */       this.dbcon.execUpdate(strSQL);
/* 529 */       strSQL = "delete from acdcdistribution  where btscode = '" + btsCode + "' ";
/* 530 */       log.info(strSQL);
/* 531 */       this.dbcon.execUpdate(strSQL);
/* 532 */       strSQL = "delete from mainssupply  where btscode = '" + btsCode + "' ";
/* 533 */       log.info(strSQL);
/* 534 */       this.dbcon.execUpdate(strSQL);
/* 535 */       strSQL = "delete from machineroom  where btscode = '" + btsCode + "' ";
/* 536 */       log.info(strSQL);
/* 537 */       this.dbcon.execUpdate(strSQL);
/* 538 */       strSQL = "delete from magnifier  where btscode = '" + btsCode + "' ";
/* 539 */       log.info(strSQL);
/* 540 */       this.dbcon.execUpdate(strSQL);
/* 541 */       strSQL = "delete from aircondition  where btscode = '" + btsCode + "' ";
/* 542 */       log.info(strSQL);
/* 543 */       this.dbcon.execUpdate(strSQL);
/* 544 */       strSQL = "delete from envmontor  where btscode = '" + btsCode + "' ";
/* 545 */       log.info(strSQL);
/* 546 */       this.dbcon.execUpdate(strSQL);
/* 547 */       strSQL = "delete from transferscircuit  where transfersid in (select u.id from (  select id from transfers where btscode = '" + btsCode + "' )as u) ";
/* 548 */       log.info(strSQL);
/* 549 */       this.dbcon.execUpdate(strSQL);
/* 550 */       strSQL = "delete from transformer  where btscode = '" + btsCode + "' ";
/* 551 */       log.info(strSQL);
/* 552 */       this.dbcon.execUpdate(strSQL);
/* 553 */       strSQL = "delete from antennafeeder  where btscode = '" + btsCode + "' ";
/* 554 */       log.info(strSQL);
/* 555 */       this.dbcon.execUpdate(strSQL);
/* 556 */       strSQL = "delete from powersupply  where btscode = '" + btsCode + "' ";
/* 557 */       log.info(strSQL);
/* 558 */       this.dbcon.execUpdate(strSQL);
/* 559 */       strSQL = "delete from powerbox  where btscode = '" + btsCode + "' ";
/* 560 */       log.info(strSQL);
/* 561 */       this.dbcon.execUpdate(strSQL);
/* 562 */       strSQL = "delete from fireextinguisher  where btscode = '" + btsCode + "' ";
/* 563 */       log.info(strSQL);
/* 564 */       this.dbcon.execUpdate(strSQL);
/* 565 */       strSQL = "delete from dynamo  where btscode = '" + btsCode + "' ";
/* 566 */       log.info(strSQL);
/* 567 */       this.dbcon.execUpdate(strSQL);
/* 568 */       strSQL = "delete from transfers  where btscode = '" + btsCode + "' ";
/* 569 */       log.info(strSQL);
/* 570 */       this.dbcon.execUpdate(strSQL);
/* 571 */       strSQL = "delete from irontower  where btscode = '" + btsCode + "' ";
/* 572 */       log.info(strSQL);
/* 573 */       this.dbcon.execUpdate(strSQL);
/* 574 */       strSQL = "delete from trafficinfo  where btscode = '" + btsCode + "' ";
/* 575 */       log.info(strSQL);
/* 576 */       this.dbcon.execUpdate(strSQL);
/*     */     }
/*     */     catch (Exception e) {
/* 579 */       flag = false;
/* 580 */       e.printStackTrace();
/* 581 */       log.error(e.getMessage());
/* 582 */       log.error("delete station failure ");
/*     */     } finally {
/* 584 */       dbConClose();
/*     */     }
/* 586 */     return flag;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getGeographicalenvByBtsName(Map condition)
/*     */   {
/* 591 */     ListContentsBFO bfo = new ListContentsBFO();
/* 592 */     int start = Integer.parseInt(condition.get("start").toString());
/* 593 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 594 */     String strBtsName = condition.get("btsName").toString();
/* 595 */     ResultSet rs = null;
/* 596 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 599 */       dbConInit();
/* 600 */       Object objRegistBeginTime = condition.get("registBeginTime");
/* 601 */       Object objRegistEndTime = condition.get("registEndTime");
/*     */ 
/* 603 */       String strSQL = " select count(btscode) from geographicalenv where btsname like '%" + strBtsName + "%' ";
/* 604 */       strSQL = FormateSQL.getFormateSQL(objRegistBeginTime, objRegistEndTime, strSQL);
/* 605 */       log.info(strSQL);
/* 606 */       rs = this.dbcon.execQuery(strSQL);
/* 607 */       if (rs.next()) {
/* 608 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 610 */       strSQL = " select * from geographicalenv where btsname like '%" + strBtsName + "%' ";
/* 611 */       strSQL = FormateSQL.getFormateSQL(objRegistBeginTime, objRegistEndTime, strSQL);
/* 612 */       strSQL = strSQL + "limit " + start + ", " + limit;
/* 613 */       log.info(strSQL);
/* 614 */       rs = this.dbcon.execQuery(strSQL);
/*     */ 
/* 616 */       int i = 0;
/* 617 */       while (rs.next())
/*     */       {
/* 619 */         GeographicalenvBo bo = new GeographicalenvBo();
/* 620 */         bo.setId(String.valueOf(i++));
/* 621 */         bo.setBtscode(rs.getString("btscode"));
/* 622 */         bo.setBtsname(rs.getString("btsname"));
/* 623 */         bo.setBtszone(rs.getString("btszone"));
/* 624 */         bo.setLandform(rs.getString("landform"));
/* 625 */         bo.setLng(rs.getString("lng"));
/* 626 */         bo.setLat(rs.getString("lat"));
/* 627 */         bo.setRelocationrd(rs.getString("relocationrd"));
/* 628 */         bo.setUsername(rs.getString("username"));
/* 629 */         bo.setDistcode(rs.getString("distcode"));
/* 630 */         bo.setBtslevel(rs.getString("btslevel"));
/* 631 */         bo.setWorkingradius(rs.getString("workingradius"));
/* 632 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 633 */         bo.setMemo(rs.getString("memo"));
/* 634 */         bo.setGraphDeatilAddr(rs.getString("graphDeatilAddr"));
/* 635 */         bo.setGraphHigh(rs.getString("graphHigh"));
/*     */ 
/* 637 */         bo.setTrannetid(rs.getString("trannetid"));
/* 638 */         bo.setTrannetname(rs.getString("trannetname"));
/* 639 */         bo.setTrannetgrade(rs.getString("trannetgrade"));
/* 640 */         bo.setRegisttime(rs.getDate("registtime"));
/* 641 */         bo.setBtskind(rs.getString("btskind"));
/* 642 */         bo.setBtstype(rs.getString("btstype"));
/* 643 */         bo.setCoverage(rs.getString("coverage"));
/* 644 */         bo.setMaintype(rs.getString("maintype"));
/*     */ 
/* 646 */         list.add(bo);
/*     */       }
/* 648 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 651 */       e.printStackTrace();
/* 652 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 655 */       dbConClose();
/*     */     }
/* 657 */     return bfo;
/*     */   }
/*     */ 
/*     */   public List export(String strBtsName, String strRegistBeginTime, String strRegistEndTime) {
/* 661 */     ResultSet rs = null;
/* 662 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 665 */       dbConInit();
/* 666 */       String strSQL = " select * from geographicalenv where btsname like '%" + strBtsName + "%' ";
/* 667 */       strSQL = FormateSQL.getFormateSQL(strRegistBeginTime, strRegistEndTime, strSQL);
/* 668 */       log.info(strSQL);
/* 669 */       rs = this.dbcon.execQuery(strSQL);
/*     */ 
/* 671 */       int i = 0;
/* 672 */       while (rs.next())
/*     */       {
/* 674 */         GeographicalenvBo bo = new GeographicalenvBo();
/* 675 */         bo.setId(String.valueOf(i++));
/* 676 */         bo.setBtscode(rs.getString("btscode"));
/* 677 */         bo.setBtsname(rs.getString("btsname"));
/* 678 */         bo.setBtszone(rs.getString("btszone"));
/* 679 */         bo.setLandform(rs.getString("landform"));
/* 680 */         bo.setLng(rs.getString("lng"));
/* 681 */         bo.setLat(rs.getString("lat"));
/* 682 */         bo.setRelocationrd(rs.getString("relocationrd"));
/* 683 */         bo.setUsername(rs.getString("username"));
/* 684 */         bo.setDistcode(rs.getString("distcode"));
/* 685 */         bo.setBtslevel(rs.getString("btslevel"));
/* 686 */         bo.setWorkingradius(rs.getString("workingradius"));
/* 687 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 688 */         bo.setMemo(rs.getString("memo"));
/* 689 */         bo.setGraphDeatilAddr(rs.getString("graphDeatilAddr"));
/* 690 */         bo.setGraphHigh(rs.getString("graphHigh"));
/* 691 */         bo.setTrannetid(rs.getString("trannetid"));
/* 692 */         bo.setTrannetname(rs.getString("trannetname"));
/* 693 */         bo.setTrannetgrade(rs.getString("trannetgrade"));
/* 694 */         bo.setRegisttime(rs.getDate("registtime"));
/* 695 */         bo.setBtskind(rs.getString("btskind"));
/* 696 */         bo.setBtstype(rs.getString("btstype"));
/* 697 */         bo.setCoverage(rs.getString("coverage"));
/* 698 */         bo.setMaintype(rs.getString("maintype"));
/*     */ 
/* 700 */         list.add(bo);
/*     */       }
/*     */     }
/*     */     catch (Exception e) {
/* 704 */       e.printStackTrace();
/* 705 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 708 */       dbConClose();
/*     */     }
/* 710 */     return list;
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.dao.station.GeographicalenvDAO
 * JD-Core Version:    0.6.2
 */